/*
ID:luongho3
LANG:JAVA
TASK:lgame
*/

import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Scanner;

public class lgame {

	public static Entry sample;
	public static int points;
	public static int dSize;
	public static Entry[] dict;
	public static Map<Character, Integer> map = new HashMap<Character, Integer>();
	public static PriorityQueue<String> pq = new PriorityQueue<String>();
	
	
	public static void main(String[] args) throws Exception {

		Scanner scannerIn = new Scanner(new File("lgame.in"));
		Scanner scannerDict = new Scanner(new File("lgame.dict"));
		PrintStream ps = new PrintStream(new File("lgame.out"));
		System.setOut(ps);
		
		initMap();
		
		String str = scannerIn.next();
		sample = new Entry(str);
		
		dSize = 0;
		List<Entry> li = new ArrayList<Entry>();
		while (scannerDict.hasNext()) {
			String tmp = scannerDict.next();
			if (tmp.charAt(0) == '.') {
				break;
			}
			else {
				Entry e = new Entry(tmp);
				if (sample.contains(e)) {
					dSize++;
					li.add(e);
				}
			}
		}
		dict = new Entry[dSize];
		dict = li.toArray(dict);
		
		Arrays.sort(dict);
		
		points = dict[dSize-1].point;
		for (int i=0;i<dSize;++i) {
			for (int j=i+1;j<dSize;++j) {
				Entry e = new Entry(dict[i].str + dict[j].str);
				if (sample.contains(e)) {
					int tmp = e.point;
					if (tmp > points) {
						points = tmp;
					}
				}
			}
		}
		
		for (int i=0;i<dSize;++i) {
			for (int j=i+1;j<dSize;++j) {
				Entry e = new Entry(dict[i].str + dict[j].str);
				if (sample.contains(e)) {
					int tmp = e.point;
					if (tmp == points) {
						String s;
						if (dict[i].str.compareTo(dict[j].str) <= 0) {
							s = dict[i].str + " " + dict[j].str;
						}
						else {
							s = dict[j].str + " " + dict[i].str;
						}
						pq.add(s);
					}
				}
			}
		}
		
		for (int i=dSize-1;i>=0;--i) {
			if (dict[i].point < points) {
				break;
			}
			else if (dict[i].point == points) {
				pq.add(dict[i].str);
			}
		}
		
		printOutput();
		
		ps.close();

	}
	
	private static void printOutput() {

//		System.out.println(dSize);
		System.out.println(points);
		
//		for (int i=0;i<dSize;++i) {
//			Entry e = dict[i];
//			System.out.println(e.str + " " + e.point);
//		}
		while (!pq.isEmpty()) {
			String s = pq.poll();
			System.out.println(s);
		}
		
	}

	public static int calc(String str) {
		int ps = 0;
		for (int i=0;i<str.length();++i) {
			char c = str.charAt(i);
			int p = map.get(c);
			ps += p;
		}
		return ps;
	}
	
	public static void initMap() {
		map.put('q', 7);
		map.put('w', 6);
		map.put('e', 1);
		map.put('r', 2);
		map.put('t', 2);
		map.put('y', 5);
		map.put('u', 4);
		map.put('i', 1);
		map.put('o', 3);
		map.put('p', 5);
		map.put('a', 2);
		map.put('s', 1);
		map.put('d', 4);
		map.put('f', 6);
		map.put('g', 5);
		map.put('h', 5);
		map.put('j', 7);
		map.put('k', 6);
		map.put('l', 3);
		map.put('z', 7);
		map.put('x', 7);
		map.put('c', 4);
		map.put('v', 6);
		map.put('b', 5);
		map.put('n', 2);
		map.put('m', 5);
	}
	
}

class Entry implements Comparable<Entry> {
	String str;
	char[] letters;
	char[] sorted;
	int point;
	int nLetters;
	
	public Entry(String str) {
		this.str = str;
		this.point = lgame.calc(str);
		this.nLetters = str.length();
		this.letters = new char[this.nLetters];
		this.sorted = new char[this.nLetters];
		for (int i=0;i<this.nLetters;++i) {
			this.letters[i] = this.str.charAt(i);
			this.sorted[i] = this.letters[i];
		}
		Arrays.sort(this.sorted);
	}

	public boolean contains(Entry e) {
		int[] count = new int[this.nLetters];		
		for (int i=0;i<e.nLetters;++i) {
			boolean match = false;
			for (int j=0;j<this.nLetters;++j) {
				if (e.letters[i] == this.letters[j]) {
					if (count[j] == 0) {
						count[j] = 1;
						match = true;
						break;
					}
				}
			}
			if (match) {
				continue;
			}
			else {
				return false;
			}
		}
		return true;
	}

	@Override
	public int compareTo(Entry e) {
		if (e.point == this.point) {
			String s1 = new String(this.sorted);
			String s2 = new String(e.sorted);			
			return s1.compareTo(s2);
		}
		else return this.point - e.point;
	}
	
}
